package com.liwei.service;

import com.liwei.dao.UserMapper;
import com.liwei.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Liwei on 2015/10/31.
 */
@Service
public class UserService {

    /**
     * 虽然只是接口，但是可以被 @Autowired 注释
     */
    @Autowired
    private UserMapper userMapper;

    public User sayHello(String id){
        User user = userMapper.selectByPrimaryKey(Integer.valueOf(id));
        System.out.println("测试是否获取到用户名 " + user.getUserRealName());
        return user;
    }
}
